package com.accedo.achievements.dataaccess.dao;

import java.util.List;
import java.util.Map;

import com.accedo.achievements.dataaccess.model.Badge;

/**
 * A DAO interface with badge model database operations
 * @author Bo Liang
 */
public interface BadgeDao {

	/**
	 * Get badge object by using this badge's serial number.
	 * @param badge_sn	badge serial number
	 * @return			badge object
	 */
	public Badge getBadgeByBadgesn(String badge_sn);
	
	/**
	 * Get badge id List by using achievement id.
	 * <p> one achievement may related several badges,
	 * it means one badge includes several achievements, 
	 * if user want to obtain this badge, they have to unlock all of the relevant achievements.
	 * And several badges may have one same achievement,
	 * this function returns these badges which have this same achievement,
	 * return these badge's id in a List
	 * 
	 * @param achi_id	achievement id
	 * @return			List of badge's id
	 */
	public List<Integer> getBadgeIdListByAchiId(int achi_id);
	
	/**
	 * Get all badge objects from the database.
	 * @return List of badge object
	 */
	public List<Badge> getBadgeList();
	
	/**
	 * Get the user's all active badge objects in Map format by using user id.
	 * <p>the active badge for user means that this user at least unlocked one achievement related this badge.
	 * this function return two types of Map key-value pair: if one badge's achievements have already totally unlocked by user, it puts <badge_id, "finished">,
	 * if one badge's achievements have not unlocked completed but at least one, it puts <badge_id, "playing"> into Map.
	 * @param user_id	user id
	 * @return			List of badge id
	 */
	public Map<Integer, String> getActiveBadgeIdMapByUserId(int user_id);
}
